#include "personstats.h"
#include"utils.h"
#include <stdlib.h>

PersonStats::PersonStats()
{
    Hp = rand() % 1000;
    double r = rand() % 250;
    r /= 100;

    Hp = Utils::clamp(Hp, 200,1000);
    resistenceSetter(r);
}

int PersonStats::hpGetter()
{
    return Hp;
}

void PersonStats::hpSetter(int value)
{
    Hp = value;
}

double PersonStats::resistenceGetter()
{
    return Resistence;
}

void PersonStats::resistenceSetter(double value)
{
    Resistence = value;
    Resistence = Utils::clampF(Resistence,0.2,2.5);
}
